package com.itheima.day04;

import java.time.Instant;
import java.time.ZoneId;
import java.util.Date;

public class Demo7 {
    public static void main(String[] args) {
        Instant now = Instant.now();
        System.out.println("now = " + now);
        System.out.println(now.atZone(ZoneId.systemDefault()));
        Date date = Date.from(now);
        System.out.println("date = " + date);
        Instant instant = date.toInstant();
        System.out.println("instant = " + instant);
        System.out.println(now.equals(instant));
    }
}
